#include "i2c.h"

void i2c_init()
{
//	if (i2c_initialized) return;

	TWIC.MASTER.CTRLB |= TWI_MASTER_SMEN_bm;   // Enable smart mode
//	TWIC.MASTER.CTRLB |= TWI_MASTER_QCEN_bm;   // Enable quick command
	TWIC.MASTER.BAUD = 35;                     // 400 kHz
	TWIC.MASTER.CTRLA |= TWI_MASTER_ENABLE_bm; // Master enable
	TWIC.MASTER.STATUS |= 0x01;                // Set bus idle

}
